<section class="invoice">
    <!-- title row -->
    <div class="row">
        <div class="col-xs-12">
            <h2 class="page-header">
                <i class="fa fa-globe"></i>{{ $admin->username }}
            </h2>
        </div>
    </div>
    <!-- info row -->
    <div class="row invoice-info">
        <div class="col-sm-4 invoice-col">
            <b>姓名:</b>  {{ $admin->name }}<br>
            <b>电话:</b>  {{ $admin->mobile }}<br>
            <!-- <b>邮箱:</b>  {{ $admin->email }}<br> -->
        </div>
        <div class="col-sm-4 invoice-col">
            <!-- <b>创建时间:</b>  {{ $admin->Create_at }}<br> -->
            <b>更新时间:</b>  {{ $admin->updated_at }}<br>
        </div>
        <div class="col-sm-4 invoice-col">
            <!-- <b>最后登录时间:</b>  {{ $admin->last_login }}<br> -->
            <b>最后登录IP:</b>  {{ $admin->login_ip }}<br>
            <b>状态:</b>
                @if($admin->status == 1)<span class="label label-success">正常</span>
                @elseif($admin->status == 0)<span class="label label-danger">禁用</span>
                @endif
            <br>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-xs-12 table-responsive">
            <table class="table table-striped">
                <thead>
                <tr>
                    <th style="width:30%">角色</th>
                    <th>权限</th>
                </tr>
                </thead>
                <tbody>
                @foreach($admin->roles as $role)
                <tr>
                    <td>{{ $role->display_name or $role->name }}</td>
                    <td>
                        @foreach($role->perms as $perm)
                            {{ $perm->display_name or $perm->name }} |
                        @endforeach
                    </td>
                </tr>
                @endforeach
                </tbody>
            </table>
        </div>
        <!-- /.col -->
    </div>
    <div class="row no-print">
        <div class="col-xs-12">
            <button type="button" class="btn btn-default" style="margin-right: 5px;" data-url="/admin/adminuser" onclick="jumpfun(this)">返回</button>
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editUserModal-{{ $admin->id }}" style="margin-right: 5px;">角色管理</button>
        </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="editUserModal-{{ $admin->id }}" tabindex="-1" role="dialog" aria-labelledby="editUserModal-{{ $admin->id }}-Label">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">角色管理</h4>
                </div>
                <form class="form-horizontal">
                  {{ csrf_field() }}
                <div class="modal-body">
                        <div class="checkbox">
                            @foreach($roles as $role)
                              @if($role->id != 1 || Auth::guard('admin')->id() == 1)
                                <label>
                                    {!! Form::checkbox('role[]', $role->id, roleCheck($role, $admin)) !!}
                                    {{ $role->display_name or $role->name }}
                                </label>
                              @endif
                            @endforeach
                        </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal" data-url="{{ url('admin/roleAdd/'.$admin->id) }}" data-type="PATCH" onclick="subAction(this)">保 存</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
                </form>
            </div>
        </div>
    </div>
</section>
